<!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    
    <meta property="og:site_name" content="Devean Blog">
    <meta property="og:type" content="article">

    
    <meta property="og:image" content="https://devean.cn/img/ladder-sky-bg.jpg">
    <meta property="twitter:image" content="https://devean.cn/img/ladder-sky-bg.jpg" />
    

    
    <meta name="title" content="机器学习 | 支持向量机线性可分" />
    <meta property="og:title" content="机器学习 | 支持向量机线性可分" />
    <meta property="twitter:title" content="机器学习 | 支持向量机线性可分" />
    

    
    <meta name="description" content="德文，程序员, 开源爱好者，生活探险家 | 这里是 德文 的博客，与你一起发现更大的世界。">
    <meta property="og:description" content="德文，程序员, 开源爱好者，生活探险家 | 这里是 德文 的博客，与你一起发现更大的世界。" />
    <meta property="twitter:description" content="德文，程序员, 开源爱好者，生活探险家 | 这里是 德文 的博客，与你一起发现更大的世界。" />
    

    
    <meta property="twitter:card" content="summary" />
    
    

    <meta name="keyword"  content="德文, Devean, DevonYe, 机器学习,量化金融, QuantitaTAtive Finance, 德文的网络日志, 德文的博客, Devean Blog, 博客, 个人网站, 互联网, Web, 云原生,微服务, Microservice">

    
    
    <meta name="baidu-site-verification" content="codeva-k4Gz4N5kH1" />
    
    <meta name="google-site-verification" content="5YbYjVsLhmXRSCU2u_xrAegZCOyvI296GhQyr-o9L9c" />


    <link rel="shortcut icon" href="/img/favicon.ico">

    <title>机器学习 | 支持向量机线性可分 | 德文的博客| Devean Blog</title>

    <link rel="canonical" href="/post/2023-11-18-machine-learning-support-vector-machine-linearly-separable/">

    
    
    
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    
    <link rel="stylesheet" href="/css/hugo-theme-cleanwhite.min.css">

    
    <link rel="stylesheet" href="/css/zanshang.css">

    
    <link rel="stylesheet" href="/css/font-awesome.all.min.css">

    
    

    
    <script src="/js/jquery.min.js"></script>

    
    <script src="/js/bootstrap.min.js"></script>

    
    <script src="/js/hux-blog.min.js"></script>

    
    <script src="/js/lazysizes.min.js"></script>

    <script src="/js/bing-clarity.min.js"></script>

    
    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js"></script>

<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
<script>
    document.addEventListener("DOMContentLoaded", function() {
        renderMathInElement(document.body, {
            delimiters: [
                {left: "$$", right: "$$", display: true},
                {left: "$", right: "$", display: false}
            ]
        });
    });
</script>
    

    
    
<script async src="https://www.googletagmanager.com/gtag/js?id=G-B430VD5TJ2"></script>
<script>
var doNotTrack = false;
if (!doNotTrack) {
	window.dataLayer = window.dataLayer || [];
	function gtag(){dataLayer.push(arguments);}
	gtag('js', new Date());
	gtag('config', 'G-B430VD5TJ2', { 'anonymize_ip': false });
}
</script>

    
</head>







<nav class="navbar navbar-default navbar-custom navbar-fixed-top">

    <div class="container-fluid">
        
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">Devean Blog</a>
        </div>

        
        
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/">All Posts</a>
                    </li>
                    
                        
                        <li>
                            <a href="/categories/finance/">finance</a>
                        </li>
                        
                        <li>
                            <a href="/categories/life/">life</a>
                        </li>
                        
                        <li>
                            <a href="/categories/tech/">tech</a>
                        </li>
                        
                    
                    
		    
                        <li><a href="/archive//">ARCHIVE</a></li>
                    
                        <li><a href="/notes//">NOTES</a></li>
                    
                        <li><a href="/about//">ABOUT</a></li>
                    
		            <li>
                        <a href="/search"><i class="fa fa-search"></i></a>
		           </li>
                </ul>
            </div>
        </div>
        
    </div>
    
</nav>
<script>
    
    
    
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        
            $navbar.className = " ";
            
            setTimeout(function(){
                
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>




<style type="text/css">
    header.intro-header {
        background-image: url('/img/ladder-sky-bg.jpg')
    }
</style>

<header class="intro-header" >

    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <div class="tags">
                        
                        <a class="tag" href="/tags/machine-learning" title="Machine Learning">
                            Machine Learning
                        </a>
                        
                    </div>
                    <h1>机器学习 | 支持向量机线性可分</h1>
                    <h2 class="subheading">Machine Learning Support Vector Machine Linearly Separable</h2>
                    <span class="meta">
                        
                            Posted by 
                            
                                     &#34;&#34;
                             
                            on 
                            Saturday, November 18, 2023
                            
                            
                            
                            
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>




<article>
    <div class="container">
        <div class="row">

            
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">

                
                <blockquote>
<p>本文从支持向量机概念、硬间隔、软间隔和非线性的区别、原理、术语、最大间隔数学推导几个方面详细讲解线性可分的支持向量机。</p>
</blockquote>
<h2 id="基础概念">基础概念</h2>
<p>支持向量机(Support Vector Machine)SVM，是一种<strong>监督学习模型</strong>，适用于<strong>二分类</strong>任务。SVM 算法的主要目标是在 N 维空间中找到能够将特征空间中不同类的数据点分开的最优超平面。超平面尝试使不同类的最近点之间的间隔尽可能最大。超平面的维度取决于特征的数量。如果输入特征的数量是两个，那么超平面只是一条线。如果输入特征的数量为三个，则超平面变为二维平面。当特征数量超过三个时就变得难以想象。</p>
<h2 id="硬间隔软间隔和非线性svm区别">硬间隔、软间隔和非线性SVM区别</h2>
<p>
  <img src="https://files.mdnice.com/user/50789/873f3f86-16a7-475d-a76e-c82e538407f0.png" alt="硬间隔">

</p>
<p>
  <img src="https://files.mdnice.com/user/50789/f27702c9-f918-442c-be8a-b455780c9676.png" alt="软间隔">

</p>
<p>
  <img src="https://files.mdnice.com/user/50789/d3cd7637-af81-4937-a6c5-d9e79a68f5ea.png" alt="非线性可分">

</p>
<p>硬间隔数据是完全准确可分的、不存在分类错误的情况，软间隔是允许一定量的样本分类错误、而线性不可分是线性公式无解，只能使用非线性方式求解的</p>
<h2 id="线性可分-svm">线性可分 SVM</h2>
<p>即假设样本数据是线性可分离的情况下，我们直接使用线性 SVM 对数据进行分类。基本原理是找到一个超平面，将数据划分为两个类，使得类别之间的间隔最大化。</p>
<h3 id="定义">定义</h3>
<p>给定训练样本集 D={(x1,y1)，(x2,y2)，&hellip;，(xm,ym)},yi∈{-1,+1}，分类学习最基本的想法就是基于训练集 D 在样本空间中找到一个划分超平面，将不同类别的样本分开。下面列子以二维数据展开、实际生活中多维数据与二维几乎无差别，只是数据特征维度变为了多维。</p>
<p>
  <img src="https://files.mdnice.com/user/50789/7783cbf9-f233-4375-a66f-5f13c2d0e12f.png" alt="">

</p>
<p>直观上看，应该去找位于两类训练样本“正中间”的划分超平面，即图中红色的那个，因为该划分超平面对训练样本局部扰动的“容忍”性最好。如果，由于训练集的局限性或噪声的因素，训练集外的样本可能比图中的训练样本更接近两个类的分隔界，这将使许多划分超平面出现错误，而红色的超平面受影响最小。</p>
<p>
  <img src="https://files.mdnice.com/user/50789/e7121abb-1413-4fc4-9abe-da4df88171d8.png" alt="">

</p>
<p>要找到最佳超平面,即得找到样本数据点离超平面最近的点的距离最大化，从上面两个图中可以看出,离图中红线最近的点即被圈住的样本到红色超平面距离最大。其中 w=(w1;w2;&hellip;;wd)为法向量，决定了超平面的方向；b 为位移项，决定了超平面与原点之间的距离。</p>
<h3 id="术语">术语</h3>
<ul>
<li><strong>向量距离</strong>：即上图中任何一个样本点到红色超平面的距离</li>
</ul>
<p>$$r= \frac {w^Tx+b} {||w||}$$</p>
<ul>
<li>
<p><strong>支持向量（support vector）</strong>：即图中圈中的样本,支持向量是距离超平面最近的数据点，在决定超平面和边距方面起着关键作用。</p>
</li>
<li>
<p><strong>决策边界</strong>:即上图中红色超平面,用于分隔特征空间中不同类的数据点。在线性分类的情况下，它将是一个线性方程
$$w^Tx+b=0$$</p>
</li>
<li>
<p><strong>上边界</strong>：将超平面放大 n 背后</p>
<p>$$w^Tx+b=1$$</p>
</li>
<li>
<p><strong>下边界</strong>：
$$w^Tx+b=-1$$</p>
</li>
<li>
<p><strong>间隔(margin)</strong>：即如图上下边界之间的距离</p>
</li>
</ul>
<p>$$\lambda=\frac {2} {||w||}$$</p>
<h3 id="求解线性-svm-决策超平面">求解线性 SVM 决策超平面</h3>
<p><strong>1. 列出知超平面方程组</strong>
$$w^Tx+b=0$$
$$w^Tx+b=1$$
$$w^Tx+b=-1$$<br>
<strong>2 假设正负超平面向量</strong>
假设正决策超平面上的存在点 $x_m$、负决策超平面上存在点 $x_n$, 求两点之间的向量可如下图</p>
<p>
  <img src="https://files.mdnice.com/user/50789/d9955cab-0792-4729-bd43-c514c8cfe1f0.png" alt="">

</p>
<p><strong>3.可将正负超平面上的向量带入方程计算</strong></p>
<p>$$\vec w_m \vec x+b=1$$
$$\vec w_n \vec x+b=-1$$</p>
<p>$$\vec {w} \cdot (\vec x_m- \vec x_n)=2$$</p>
<p><strong>4.在决策超平面上假设存在两点 $x_p,x_q$</strong></p>
<p>
  <img src="https://files.mdnice.com/user/50789/b589ed35-3e7a-45ec-96af-215cd56b4f3a.png" alt="">

</p>
<p>$$\vec w_p \vec x+b=0$$
$$\vec w_q \vec x+b=0$$</p>
<p>$$\vec {w} \cdot (\vec x_p- \vec x_q)=0$$</p>
<p><strong>5. 由此 我们可推出向量 $\vec w$ 与超平面垂直，即为超平面的法向量</strong></p>
<p><strong>6.基于向量定理计算</strong>
根据已知,及上图结论，我们可推导出
$$\vec {w} \cdot (\vec x_m- \vec x_n)=2$$
$$||\vec x_m- \vec x_n|| * cos \theta * ||\vec {w} || =2$$</p>
<p><strong>7. 推导间隔 L</strong>
从上图中可以看出向量 $\vec x_m- \vec x_n$ 投影到法向量 $\vec w$ 上，就等于间隔 L</p>
<p>$$||\vec x_m- \vec x_n|| * cos \theta  =L$$</p>
<p>$$L * ||\vec {w} || =2$$</p>
<p>$$L = \frac {2}  {||\vec {w} ||}$$</p>
<p><strong>8.定义问题</strong>
我们的目标是最大化分类间隔，即最大化 $\frac{2}{|w|}$。等价地，我们最小化 $\frac{1}{2} |w|^2$。优化问题可以写成：</p>
<p><strong>最小化:</strong></p>
<p>$$
\frac{1}{2} |w|^2
$$</p>
<p><strong>约束条件:</strong></p>
<p>$$
y_i(w \cdot x_i + b) \geq 1 \quad \text{for all } i = 1, 2, \ldots, m
$$</p>
<p><strong>9. 引入拉格朗日乘子：</strong></p>
<p>引入拉格朗日乘子 $\alpha_i \geq 0$，定义拉格朗日函数：</p>
<p><strong>拉格朗日方程:</strong></p>
<p>$$
L(w, b, \alpha) = \frac{1}{2} |w|^2 - \sum_{i=1}^{m} \alpha_i [y_i(w \cdot x_i + b) - 1]
$$</p>
<p><strong>10. 求解对偶问题：</strong></p>
<p>通过对拉格朗日函数对 $w$ 和 $b$ 求偏导数，并令其等于零，我们得到：</p>
<p><strong>偏导数与置换:</strong></p>
<p>$$
w = \sum_{i=1}^{m} \alpha_i y_i x_i
$$</p>
<p><strong>对偶问题:</strong></p>
<p>$$
\text{maximize} \quad W(\alpha) = \sum_{i=1}^{m} \alpha_i - \frac{1}{2} \sum_{i,j=1}^{m} \alpha_i \alpha_j y_i y_j x_i \cdot x_j
$$</p>
<p>$$
\text{subject to} \quad \alpha_i \geq 0, \quad \sum_{i=1}^{m} \alpha_i y_i = 0
$$</p>
<p><strong>11. 最大化间隔的数学表达：</strong></p>
<p>通过对偶问题的求解，得到一组优化的拉格朗日乘子 $\alpha^*$。最大化分类间隔的数学表达式为：</p>
<p><strong>最大间隔:</strong></p>
<p>$$
\text{maximize} \quad \frac{2}{|w|} = \frac{2}{\sqrt{\sum_{i=1}^{m} (\alpha_i^* y_i x_i)^2}}
$$</p>
<p><strong>12. 计算最大间隔：</strong></p>
<p>最大间隔的计算是通过对偶问题中的 $\alpha^<em>$ 计算得到的。具体地，最大间隔是 $\frac{2}{|w|}$，其中 $w$ 由 $\sum_{i=1}^{m} \alpha_i^</em> y_i x_i$ 计算得到。</p>
<blockquote>
<blockquote>
<p>欢迎大家关注

  <img src="https://files.mdnice.com/user/50789/e5f12b6f-3e5c-4dfe-bab9-f074734d3e37.png" alt="">

</p>
</blockquote>
</blockquote>
<h2 id="往期推荐">往期推荐</h2>
<ul>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484391&amp;idx=1&amp;sn=716e299395f39c6ee2af72227f34b255&amp;chksm=fb41f3f2cc367ae4f2f89dd7ed47de8378c35abc5904241b7d247e87cd707668b1bb09129a7b#rd">一文看懂机器学习</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484401&amp;idx=1&amp;sn=0b67c4ad3e7608009ae920571f2fd308&amp;chksm=fb41f3e4cc367af2f41d9b17f6f2a8310d5cb299bfa355618907f4e0202522d9e2b3e19d5c91#rd">机器学习-房价预测建模</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484401&amp;idx=1&amp;sn=0b67c4ad3e7608009ae920571f2fd308&amp;chksm=fb41f3e4cc367af2f41d9b17f6f2a8310d5cb299bfa355618907f4e0202522d9e2b3e19d5c91#rd">机器学习 | 基础术语与符号</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484510&amp;idx=1&amp;sn=bb7cf6117c620aae01064f1051730c29&amp;chksm=fb41f44bcc367d5d223dd7a8d445e92d97e2e993a49d122e019f80a1555b0b651567f5056060#rd">机器学习 | 特征缩放</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484572&amp;idx=1&amp;sn=e8fed49378732bd5c40f6130dd42ec7c&amp;chksm=fb41f489cc367d9fa1483192ace36bad08a49c546a1b8e19c2350e14e6d2693cf39fd27dabf5#rd">机器学习| K 近临(K Nearest-Neighbours)</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484576&amp;idx=1&amp;sn=272c2f834eb92197d382ca7164a097a1&amp;chksm=fb41f4b5cc367da36d40622bbc097cb19e9cccad76062c33c49d494205ce2473720318e6a914#rd">机器学习| K邻近疾病预测演示</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484610&amp;idx=1&amp;sn=e5ddd983cd1f32b52524a8ae846c36f1&amp;chksm=fb41f4d7cc367dc10d15fecadaa82ef74b5ab5c71704fb869fd1c62ad0da6e17cb037a31ca66#rd">机器学习 | K均值聚类(K-means Clustering)</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484764&amp;idx=1&amp;sn=08ec391ef9a85c25d8205a3574b4a636&amp;chksm=fb41f549cc367c5f1fb90a3f9735831576334566afd7d409f063cd329e8af81a79a797f9104f#rd">机器学习 | 朴素贝叶斯原理实战</a></p>
</li>
<li>
<p><a href="https://mp.weixin.qq.com/s?__biz=MzU0ODMzMzk0Ng==&amp;mid=2247484791&amp;idx=1&amp;sn=5fb140a07fe30805d785303d55307b14&amp;chksm=fb41f562cc367c74b5ae84e05093062b79a8827a505de7b858f2c76414a29ea9d94e08aaaaa5#rd">机器学习 | 线性回归</a></p>
</li>
</ul>


                
                
<div class="entry-shang text-center">
    
	    <p>「真诚赞赏，手留余香」</p>
	
	<button class="zs show-zs btn btn-bred">赞赏支持</button>
</div>
<div class="zs-modal-bg"></div>
<div class="zs-modal-box">
	<div class="zs-modal-head">
		<button type="button" class="close">×</button>
		<span class="author"><a href="https://devean.cn"><img src="/img/favicon.png" />Devean Blog</a></span>
        
	        <p class="tip"><i></i><span>真诚赞赏，手留余香</span></p>
		
 
	</div>
	<div class="zs-modal-body">
		<div class="zs-modal-btns">
			<button class="btn btn-blink" data-num="2">2元</button>
			<button class="btn btn-blink" data-num="5">5元</button>
			<button class="btn btn-blink" data-num="10">10元</button>
			<button class="btn btn-blink" data-num="50">50元</button>
			<button class="btn btn-blink" data-num="100">100元</button>
			<button class="btn btn-blink" data-num="1">任意金额</button>
		</div>
		<div class="zs-modal-pay">
			<button class="btn btn-bred" id="pay-text">2元</button>
			<p>使用<span id="pay-type">微信</span>扫描二维码完成支付</p>
			<img src="/img/reward/wechat-2.png"  id="pay-image"/>
		</div>
	</div>
	<div class="zs-modal-footer">
		<label><input type="radio" name="zs-type" value="wechat" class="zs-type" checked="checked"><span ><span class="zs-wechat"><img src="/img/reward/wechat-btn.png"/></span></label>
		<label><input type="radio" name="zs-type" value="alipay" class="zs-type" class="zs-alipay"><img src="/img/reward/alipay-btn.png"/></span></label>
	</div>
</div>
<script type="text/javascript" src="/js/reward.js"></script>

                

                
                <hr>
                <ul class="pager">
                    
                    <li class="previous">
                        <a href="/post/2023-11-15-what-is-arbitrage/" data-toggle="tooltip" data-placement="top" title="翻译 | 什么是套利">&larr;
                            Previous Post</a>
                    </li>
                    
                    
                </ul>
                

                



            </div>

            
            
            <div class="
                col-lg-2 col-lg-offset-0
                visible-lg-block
                sidebar-container
                catalog-container">
                <div class="side-catalog">
                    <hr class="hidden-sm hidden-xs">
                    <h5>
                        <a class="catalog-toggle" href="#">CATALOG</a>
                    </h5>
                    <ul class="catalog-body"></ul>
                </div>
            </div>
            

            
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                
                
                <section>
                    <hr class="hidden-sm hidden-xs">
                    <h5><a href="/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                        
                        
                        
                        <a href="/tags/machine-learning" title="machine-learning">
                            machine-learning
                        </a>
                        
                        
                        
                        <a href="/tags/quantitative-finance" title="quantitative-finance">
                            quantitative-finance
                        </a>
                        
                        
                        
                        
                    </div>
                </section>
                

                
                
                <section>
                    <hr>
                    <h5>FRIENDS</h5>
                    <ul class="list-inline">
                        
                        <li><a target="_blank" href=""></a></li>
                        
                    </ul>
                </section>
                
            </div>
        </div>
    </div>
</article>




<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">                  
                    
                    <li>
                        <a href="mailto:devean.ye@gmail.com">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fas fa-envelope fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
		           
                    
                    
                    <li>
                        <a target="_blank" href="https://www.zhihu.com/people/devonaha">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fab  fa-stack-1x fa-inverse">知</i>
                            </span>
                        </a>
                    </li>
		            
                    
                    

		            
                    
                    <li>
                        <a target="_blank" href="/img/wechat-QRCode.png">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fab fa-weixin fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
		            
                    
                    <li>
                        <a target="_blank" href="https://github.com/devon-ye">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fab fa-github fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
		            
                    
                    
                    
                    <li>
                        <a target="_blank" href="https://www.linkedin.com/in/yourlinkedinid">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fab fa-linkedin fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
		           
                    
                    
                    <li>
                        <a target="_blank" href="https://stackoverflow.com/users/7220519">
                            <span class="fa-stack fa-lg">
                                <i class="fas fa-circle fa-stack-2x"></i>
                                <i class="fab fa-stack-overflow fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                    
                    
                    
                    
                    
            
            
            
           
                   <li>
                       <a href='' rel="alternate" type="application/rss+xml" title="Devean Blog" >
                           <span class="fa-stack fa-lg">
                               <i class="fas fa-circle fa-stack-2x"></i>
                               <i class="fas fa-rss fa-stack-1x fa-inverse"></i>
                           </span>
                       </a>
                   </li>
            
             </ul>
		<p class="copyright text-muted">
                    Copyright &copy; Devean Blog 2023
                    <br>
                    <a href="https://themes.gohugo.io/hugo-theme-cleanwhite">CleanWhite Hugo Theme</a> by <a href="https://zhaohuabing.com">Huabing</a> |
                    <iframe
                        style="margin-left: 2px; margin-bottom:-5px;"
                        frameborder="0" scrolling="0" width="100px" height="20px"
                        src="https://ghbtns.com/github-btn.html?user=zhaohuabing&repo=hugo-theme-cleanwhite&type=star&count=true" >
                    </iframe>
                </p>
            </div>
        </div>
    </div>
</footer>




<script>
    function loadAsync(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>






<script>
    
    if($('#tag_cloud').length !== 0){
        loadAsync("/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>


<script>
    loadAsync("https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>






<script type="text/javascript">
    function generateCatalog(selector) {

        
        
        
        
            _containerSelector = 'div.post-container'
        

        
        var P = $(_containerSelector), a, n, t, l, i, c;
        a = P.find('h1,h2,h3,h4,h5,h6');

        
        $(selector).html('')

        
        a.each(function () {
            n = $(this).prop('tagName').toLowerCase();
            i = "#" + $(this).prop('id');
            t = $(this).text();
            c = $('<a href="' + i + '" rel="nofollow">' + t + '</a>');
            l = $('<li class="' + n + '_nav"></li>').append(c);
            $(selector).append(l);
        });
        return true;
    }

    generateCatalog(".catalog-body");

    
    $(".catalog-toggle").click((function (e) {
        e.preventDefault();
        $('.side-catalog').toggleClass("fold")
    }))

    


    loadAsync("\/js\/jquery.nav.js", function () {
        $('.catalog-body').onePageNav({
            currentClass: "active",
            changeHash: !1,
            easing: "swing",
            filter: "",
            scrollSpeed: 700,
            scrollOffset: 0,
            scrollThreshold: .2,
            begin: null,
            end: null,
            scrollChange: null,
            padding: 80
        });
    });
</script>






</body>
</html>
